package com.cedric.yixianpai.game.cards.Sects.swordCards.b_ZhuJi;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 云剑·极意
 */
@Component
public class Yun_JiYi extends SwordCard {
    protected int heal;

    /**
     * 云剑·极意
     * 6/8/10 + 2/3/4剑意
     */
    public Yun_JiYi(@Value("1") int lvl) {
        super("云剑·极意");
        this.setPeriod(Period.ZHUJI);
        this.setDescription("6/8/10 攻 连云：2/3/4剑意");
        this.setCardType(CardType.YUN);
        if (1 == lvl) {
            this.setLevel(1);
            this.setDamage(6);
            this.setSwordIntent(2);
        } else if (2 == lvl) {
            this.setLevel(2);
            this.setDamage(8);
            this.setSwordIntent(3);
        } else if (3 == lvl) {
            this.setLevel(3);
            this.setDamage(10);
            this.setSwordIntent(4);
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.attack(Sta2, this.getDamage());
        Sta1.getPlayerBuff().setSwordIntent(0);
        if (Sta1.lastIs(CardType.YUN)) {
            Sta1.getPlayerBuff().addSwordIntent(this.getSwordIntent());
        }
        return true;
    }
}
